//
//  CZAccount.m
//  OCKSFWeibo
//
//  Created by 盛 发 况 on 16/4/21.
//  Copyright © 2016年 盛 发 况. All rights reserved.
//

#import "CZAccount.h"
#import <MJExtension.h>

@implementation CZAccount

//字典转模型
+ (instancetype)accountWithDict:(NSDictionary *)dict {

    CZAccount *account = [[CZAccount alloc] init];
    [account setValuesForKeysWithDictionary:dict];

    return account;
}

//设置过期时间
- (void)setExpires_in:(NSString *)expires_in {
    
    _expires_in = expires_in;
    
    // 计算过期的时间 = 当前时间 + 有效期
    _expires_date = [NSDate dateWithTimeIntervalSinceNow:[expires_in longLongValue]];
}

@end


